import request from '@/utils/request'

// 查询公司估值列表
export function listDealCompanyValuation(query) {
  return request({
    url: '/companyvaluation/dealCompanyValuation/list',
    method: 'get',
    params: query
  })
}

// 查询公司估值详细
export function getDealCompanyValuation(id) {
  return request({
    url: '/companyvaluation/dealCompanyValuation/' + id,
    method: 'get'
  })
}

// 保存公司估值
export function saveDealCompanyValuation(data) {
  return request({
    url: '/companyvaluation/dealCompanyValuation/save',
    method: 'post',
    data: data
  })
}

// 删除公司估值
export function delDealCompanyValuation(id) {
  return request({
    url: '/companyvaluation/dealCompanyValuation/' + id,
    method: 'delete'
  })
}

// 导出公司估值
export function exportDealCompanyValuation(query) {
  return request({
    url: '/companyvaluation/dealCompanyValuation/export',
    method: 'get',
    params: query
  })
}

// 查询公司估值信息返回给Chart组件使用
export function companyValuationChart(query) {
  return request({
    url: '/companyvaluation/dealCompanyValuation/companyValuationChart',
    method: 'get',
    params: query
    // params: { 'dealId': query.dealId, 'quarterOrMonth': query.quarterOrMonth }
  })
}

// 项目最新(估值时间)估值
export function findLatestValuation(query) {
  return request({
    url: '/companyvaluation/dealCompanyValuation/findLatestValuation',
    method: 'get',
    params: query
  })
}

// 上市后根据基准日和项目ID获取股价
export function getStockPriceByDealId(dealId, date) {
  return request({
    url: '/companyvaluation/dealCompanyValuation/getStockPriceByDealId/' + dealId + '/' + date,
    method: 'get'
  })
}
